import os

# 基准上传目录
UPLOAD_BASE = 'uploads'

# 子目录配置
RAW_IMAGES_DIR = os.path.join(UPLOAD_BASE, 'raw_images')
PREPROCESSED_IMAGES_DIR = os.path.join(UPLOAD_BASE, 'preprocessed_images')
INFERENCE_RESULTS_DIR = os.path.join(UPLOAD_BASE, 'inference_results')
MARKED_VEHICLE_DIR = os.path.join(INFERENCE_RESULTS_DIR, 'marked_vehicle')
MARKED_PLATE_DIR = os.path.join(INFERENCE_RESULTS_DIR, 'marked_plate')
CROPPED_PLATE_DIR = os.path.join(INFERENCE_RESULTS_DIR, 'cropped_plate')

# 确保所有必要的目录存在
for directory in [
    RAW_IMAGES_DIR,
    PREPROCESSED_IMAGES_DIR,
    INFERENCE_RESULTS_DIR,
    MARKED_VEHICLE_DIR,
    MARKED_PLATE_DIR,
    CROPPED_PLATE_DIR
]:
    if not os.path.exists(directory):
        os.makedirs(directory) 